"""
异常演示
"""
# 捕捉异常语法
try:
    f = open(r"D:\python_test\2025_python\python_test\25_9_4.txt", "r")
except Exception as e:   #except 异常 as 别名
    print("出现异常了")
    f = open(r"D:\python_test\2025_python\python_test\25_9_4.txt", "w")
else:
    print("无异常")
finally:
    print("我都执行")
    f.close()


